﻿<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TrainingsSchedules>" %>--%>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TrainingsSchedules>" %>

<%
    var trainersCol = new CRM.Database.Model.TrainingsTrainersCollection(); 
%> 

<%
    Html.DevExpress().ComboBox(settings =>
                                   {
                                       settings.Name = "IdTrainingsTrainer";
                                       settings.CallbackRouteValues = new {Controller = "TC", Action = "TrainingsSchedulesEditTrainersPartial"};
                                       settings.Properties.ValueType = typeof (int);
                                       settings.Properties.TextField = "Name";
                                       settings.Properties.ValueField = "IdTrainingsTrainer";
                                       settings.Properties.EnableCallbackMode = true;
                                       settings.Width = 300;
                                       settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['Country'] = IdTrainingsCource.GetValue(); }";
                                       settings.Properties.ClientSideEvents.EndCallback = "function(s, e) {IdTrainingsPlace.PerformCallback();}";
                                   }).BindList(trainersCol.GetTrainersListByCourseId(Model.IdTrainingsCource)).Bind(Model.IdTrainingsTrainer).GetHtml();
  
//}).BindList(DB.GetTrainingsTrainersListByCourseId(Model.IdTrainingsCource).OrderBy(p=>p.Name)).Bind(Model.IdTrainingsTrainer).GetHtml()
%>